-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: log multiple errors #14064
chore: log multiple errors #14064
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14064 +/- ##
=======================================
Coverage 66.40% 66.40%
=======================================
Files 1641 1641
Lines 63518 63520 +2
Branches 6422 6422
=======================================
+ Hits 42176 42181 +5
+ Misses 19681 19678 -3
Partials 1661 1661
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
action=f"db_connection_failed.{exception.__class__.__name__}" | ||
action="db_connection_failed.{}.{}".format( | ||
exception.__class__.__name__, | ||
".".join(exception.get_list_classnames()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we sort the list of class names, so that the exceptions with the same classes get grouped together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good.. is it more or less helpful to see both errors if they are identical? How about filtering out duplicates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think filtering duplicates make sense.
".".join(exception.get_list_classnames()), | |
".".join(sorted(exception.get_list_classnames())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we filter out duplicates, do we still need to sort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion, I added the sort to the get_list_classnames method above.
superset/commands/exceptions.py
Outdated
def get_list_classnames(self) -> List[str]: | ||
return list( | ||
dict.fromkeys([ex.__class__.__name__ for ex in self._invalid_exceptions]) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_list_classnames(self) -> List[str]: | |
return list( | |
dict.fromkeys([ex.__class__.__name__ for ex in self._invalid_exceptions]) | |
) | |
def get_list_classnames(self) -> List[str]: | |
return list(set(ex.__class__.__name__ for ex in self._invalid_exceptions)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will a set preserve ordering?
action=f"db_connection_failed.{exception.__class__.__name__}" | ||
action="db_connection_failed.{}.{}".format( | ||
exception.__class__.__name__, | ||
".".join(exception.get_list_classnames()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think filtering duplicates make sense.
".".join(exception.get_list_classnames()), | |
".".join(sorted(exception.get_list_classnames())), |
bd41db0
to
d5c6329
Compare
d5c6329
to
1d29e9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was about to celebrate its first birthday! :)
Oh my goodness.. haha. :) |
* log all errors from db create * return unique set of errors * sort set for exceptions list * run black (cherry picked from commit c143b37)
SUMMARY
The database create command can have multiple errors, but when they are logged, we only see the
DatabaseInvalidError
. This change passes all of the errors to the loggerTEST PLAN
unit test added
ADDITIONAL INFORMATION